package routers

import (
	"giv-vue-blog/api"
	"giv-vue-blog/middleware"
)

func (router RouterGroup) ArticleRouter() {
	articleApi := api.ApiGroupApp.ArticleApi
	router.POST("articles", middleware.JwtAuth(), articleApi.ArticleCreateView)
	router.GET("articles", middleware.JwtAuth(), articleApi.ArticleListView)
	router.GET("articles/detail", middleware.JwtAuth(), articleApi.ArticleDetailByTitleView)
	router.GET("articles/calendar", middleware.JwtAuth(), articleApi.ArticleCalendar)
	router.GET("articles/tags", middleware.JwtAuth(), articleApi.ArticleTagList)
	router.PUT("articles", middleware.JwtAuth(), articleApi.ArticleUpdate)
	router.DELETE("articles", middleware.JwtAuth(), articleApi.ArticleDel)
	router.POST("articles/collects", middleware.JwtAuth(), articleApi.ArticleCollCreateView)
	router.GET("articles/collect", middleware.JwtAuth(), articleApi.ArticleCollListView)
	router.DELETE("articles/collects", middleware.JwtAuth(), articleApi.ArticleCollRemoveView)
	router.GET("articles/full_search", articleApi.FullTextSearch) //全文搜索
	router.GET("articles/:id", middleware.JwtAuth(), articleApi.ArticleDetail)
}
